package com.zkw.service;

import com.zkw.mapper.BookMapper;
import com.zkw.pojo.Books;

import java.util.List;

public class BookServiceImpl implements BookService {
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    public int delBookById(int id) {
        return bookMapper.delBookById(id);
    }

    public int updateBookById(Books books) {
        System.out.println("BookServiceImpl:updateBookById===>"+books);
        return bookMapper.updateBookById(books);
    }

    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    public List<Books> queryNameBook(String name) {
        return bookMapper.queryNameBook(name);
    }
}
